<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
             数组值的获取和设置
                   设置：
                      -通过下标拿到某个位置的值可以直接赋值，如果已经存在则直接覆盖
        */


        var arrl = [1, 2, 3, 4, 5];
        arrl[4] ="8";
        console.log(arrl);
        arrl[100] = 10;
        console.log(arrl);
        //[]内部可以书写操作符运算
        arrl[0 ? 3 :2] = 30;
        console.log(arrl)
        console.log(arrl)


        //获取的是没有这个属性，则返回undefined
        console.log(arrl[100000])
        console.log(arrl[1])
        console.og(arrl[1 + 1])
    </script>
</body>
</html>